<?php
ob_start();
include('common/connection.php');
$uid=$_GET['uid'];
if($uid)
{
$queryUser="SELECT * FROM users WHERE `id`=$uid";
$resultUser=mysql_db_query($db_name,$queryUser);
$rsUser=mysql_fetch_array($resultUser);
}

if($_POST['group'])
{
	$group=$_POST['group'];
	$batch =$_POST['batch'];
}
else
{
	$group=$rsUser['group'];
	$batch =$rsUser['batch'];
}
?>
<style type="text/css">
.b {
	border: thin solid #eeddcc;
}
.jobin_text1 {
	BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #4b507a 1px solid; BORDER-LEFT: #4b507a 1px solid; BORDER-RIGHT: #4b507a 1px solid; BORDER-TOP: #4b507a 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; WIDTH: 350px
}
.jobin_small {
	BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #4b507a 1px solid; BORDER-LEFT: #4b507a 1px solid; BORDER-RIGHT: #4b507a 1px solid; BORDER-TOP: #4b507a 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; WIDTH: 250px
}
.jobin_smalls {
	BACKGROUND-COLOR: #ffffff; BORDER-BOTTOM: #4b507a 1px solid; BORDER-LEFT: #4b507a 1px solid; BORDER-RIGHT: #4b507a 1px solid; BORDER-TOP: #4b507a 1px solid; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 11px; WIDTH: 130px
}

.text2 {
	FONT-SIZE: 11px; FONT-WEIGHT: bold; COLOR: #4b507a; FONT-FAMILY: lucida grande, tahoma, verdana, arial, sans-serif; TEXT-DECORATION: none
}  
.top_border {
	border-top-width: 1px;
	border-top-style: solid;
	border-top-color: #009ACE;
} 
.style2 {color: #FF0000}
</style>
<script language="javascript">
function selectgroup()
{
	document.form1.action="containeradmin.php?area=user&action=update_user&uid=<?php echo $uid;?>";
	document.form1.submit();	
}
</script>
<form name="form1" method="post" action="containeradmin.php?area=user&action=update_user_do" enctype="multipart/form-data">
<table width="100%"  border="0" cellspacing="1" cellpadding="1" align="center">
    
	<tr>
      <td colspan="3" bgcolor="#D5F4FF" class="top_border" style="font-family:verdana,arial;font-size:14px;font-weight:bold;color:#006666;" align="center"><table width="100%" border="0">
              <tr>
                <td align="center" class="style6 style7">Update User</td>
			  </tr>
          </table></td>
    </tr>
	<tr bgcolor="#f8f8f8">
	 <th width="39%">&nbsp;</th>
      <th colspan="2" align="center" class="text2">&nbsp;</th>	 
    </tr>
	<?php $mess=$_GET['mess'];if($mess){?>
    <tr bgcolor="#e9ece9">
	 <th colspan="3"><?php if($mess==1){echo "<font face='Verdana, Arial, Helvetica, sans-serif' color='#006633' size='2px'>User Update Successful<font>";}elseif($mess==2){echo "<font face='Verdana, Arial, Helvetica, sans-serif' color='#FF0000' size='2px'>User Update UnSuccessful<font>";}else{echo "";}?></th>
    </tr>
	<?php }?> 
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Group:</th>
      <td width="61%" colspan="2" align="left"><select name="group" id="group" >
                            <option value="">&nbsp;&nbsp;- - -</option>
                            <option value="1"<?php if($group==1){echo "Selected";}?>>Science</option>
                            <option value="2"<?php if($group==2){echo "Selected";}?>>Commerce</option>
                            <option value="3"<?php if($group==3){echo "Selected";}?>>Arts</option>
                    </select></td>
    </tr>
    <tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Batch:</th>
      <td width="61%" colspan="2" align="left"><select name="batch" id="batch">
                          <option value="">---</option>
                                    <?php 
										for($i=2012;$i>=1972; $i--){
									?>
                                    	<option value="<?php echo $i;?>" <?php if($batch==$i){?>selected="selected"<?php }?>>
											<?php echo $i;?>
                                        </option>
                                    <?php }?>
                        </select></td>
    </tr>
    <tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Gender:</th>
      <td width="61%" colspan="2" align="left"><select name="gender" id="gender">
                      <option value="">&nbsp;&nbsp;- - -</option>
                      <option value="1"<?php if($rsUser['gender']==1){echo "Selected";}?>>Male</option>
                      <option value="2"<?php if($rsUser['gender']==2){echo "Selected";}?>>Female</option>
                    </select></td>
    </tr>   
    <tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Full Name:</th>
      <td width="61%" colspan="2" align="left"><input type="text" name="full_name" id="full_name" size="40" value="<?php echo $rsUser['f_name'];?>" /></td>
    </tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Nick Name:</th>
      <td width="61%" colspan="2" align="left"><input type="text" name="nick_name" id="nick_name" value="<?php echo $rsUser['n_name'];?>" /></td>
    </tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Cell no 1:</th>
      <td width="61%" colspan="2" align="left"><input type="text" name="cell_phone" id="cell_phone" onKeyPress="return validate_for_integers(this, event, cell_phone)" value="<?php echo $rsUser['cell_num'];?>" /></td>
    </tr>
        
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Email:</th>
      <td width="61%" colspan="2" align="left"><input type="text" name="email" id="email" onkeyup="js_validate(this.value)" value="<?php echo $rsUser['email'];?>"/></td>
    </tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Postal Address:</th>
      <td width="61%" colspan="2" align="left"><textarea name="address" id="address" cols="45" rows="5"><?php echo $rsUser['address'];?></textarea></td>
    </tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Registration Amount:</th>
      <td width="61%" colspan="2" align="left"><input type="type" name="amount" id="amount" value="<?php echo $rsUser['amount'];?>" /> </td>
    </tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Bringing Spouse:</th>
      <td width="61%" colspan="2" align="left"><?php $opt2=$rsUser['spouse'];?><input type="radio" name="spouse" id="spouse" value="1"<?php if($opt2==1){echo "Checked";}?> />Yes
                      &nbsp;&nbsp;&nbsp;<input type="radio" name="spouse" id="spouse" value="2"<?php if($opt2==2){echo "Checked";}?>N0 /></td>
    </tr>
    <tr bgcolor="#f8f8f8">
      <th class="text2" align="right">ID:</th>
      <td width="61%" colspan="2" align="left"><input type="text" name="origin" id="origin" value="<?php echo $rsUser['verify'];?>"/></td>
    </tr>
	<tr bgcolor="#f8f8f8">
      <th class="text2" align="right">Status: </th>
      <td width="61%" colspan="2" align="left"><input type="checkbox" name="status" value="1"<?php if($rsUser['status']==1)echo "Checked";?> /></td>
	</tr>

    <tr bgcolor="#f8f8f8">
      <th colspan="3">&nbsp;</th>
    </tr>
	<tr>
      <th colspan="3"><input type="submit" name="Submit" value="Update"><input type="hidden" name="uid" value="<?php echo $uid;?>" /></th>
    </tr>
  </table>
</form>
